<?php echo $this->load->view('meta'); ?>
<link rel="stylesheet" href="<?=base_url()?>templates/fall2009/css/datepicker.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?=base_url()?>templates/fall2009/css/calendar.css" type="text/css" media="screen" />
<script src="<?=base_url();?>js/date.js" type="text/javascript"></script>
<!--[if IE]><script type="text/javascript" src="jquery.bgiframe.js"></script><![endif]-->
<script src="<?=base_url();?>js/jquery.datePicker.js" type="text/javascript"></script>
<script src="<?=base_url();?>js/jquery.timePicker.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?=base_url();?>templates/fall2009/css/timepicker.css" type="text/css" media="screen" />
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=<?=$this->load->view('googlemapsapi');?>" type="text/javascript"></script>
<script src="<?=base_url();?>js/calendar.js" type="text/javascript"></script>
<style type="text/css">
label {display:inline;}
</style>
<script type="text/javascript">
	function show(id,html){
		$("#"+id).html(html).animate({opacity: 0.9}).fadeIn();;
	}
	function hide(id){
		$("#"+id).animate({opacity: 1.0}).fadeOut();
	}
</script>
<title>xa-ncsu | calendar</title>
<?php echo $this->load->view('header'); ?>
<div id="content">
<?=$this->validation->error_string;?>
<? $hour['all'] = 'all'; $mins['all'] = 'all'?>
<?	for($i=1;$i<=12;$i++){
					$hour[$i] = $i;
				}
				for($i=0;$i<=59;$i++){
					$mins[sprintf("%02d",$i)] = sprintf("%02d",$i);
				}
				$half = array('am'=>'am','pm'=>'pm');
				$homepage = array('0'=>'no','1'=>'yes');
				$repeating = array('no'=>'no','weekly'=>'weekly');
				$repeats = array('0'=>'Does not repeat','1'=>'Daily','2'=>'Every weekday (Mon-Fri)','3'=>'Every Mon., Wed., and Fri.',
							'4'=>'Every Tues. and Thur.','5'=>'Weekly','6'=>'Monthly','7'=>'Yearly');
				$repeat_js = 'onChange="repeat_main(this.form)"';
			?>
<form name='event' id="event" method="post" action="<?=site_url("calendar/doEditEvent/$event->id/$edit")?>" style="width:700px;">
<fieldset>
	<legend><span>edit a calendar entry</span></legend>
	<ol>
		<li><label for="name">what
			<input type="text" name="name" value="<?=$event->name;?>" class="calendarform"/></label></li>
		<li><label for="when">when
			<input type="text" id="startDay" name="startDay" value="<?=$event->startDay;?>" autocomplete="off" class="date-pick" style="width:80px;margin: 5px 0px 5px 115px;"  maxlength="10" onChange="dateChanged(this.form)"/>
			<span id="stime"><input type="text" name="startTime" id="startTime" class="startTime" value="<?=$event->startTime;?>" autocomplete="off"
			 style="width:86px;margin: 5px 0px 5px 5px;" maxlength="10"/></span>
			<input type="text" name="endDay" value="<?=$event->endDay;?>" autocomplete="off" class="date-pick" style="width:86px;margin: 5px 0px 5px 5px;" maxlength="10"/>
			<span id="etime"><input type="text" name="endTime" id="endTime" autocomplete="off" class="startTime" value="<?=$event->endTime;?>" style="width:100px;margin: 5px 0px 5px 5px;" maxlength="10"/></span>
			<input value="all_day" onclick="allDay(this.form)" id="aday" name="aday" type="checkbox">&nbsp;All day
			</label></li>
		<li><label for="repeats" style="margin: 0 0 0 20px;">repeats:
			<?=form_dropdown('repeat_when',$repeats,$event->repeat_when,$repeat_js)?>
			<?if($event->repeat_when!=0):?>
				<div id="repeat_here" style="display:block; margin:5px;">
				<script type="text/javascript">
					var repeat_end = "<?=$event->repeatingEnd;?>";
					repeat_main();
				</script>
			</div>
			<?endif;?>
			<span id="repeat_here" style="display:block; margin:5px;"></span>
		<li><label for="building">building
			<input type="text" name="building" id="building" value="<?=$event->building;?>" class="calendarform"/></label></li>	
		<li><label for="where">where
			<input type="text" name="where" id="where" value="<?=$event->where;?>" class="calendarform" onchange="geocode(this.form)"/></label></li>
			<input type="hidden" name="street" id="street" value="<?=$event->street?>" />
			<input type="hidden" name="city" id="city" value="<?=$event->city?>" />
			<input type="hidden" name="state" id="state" value="<?=$event->state?>" />
			<li><label for="description">description</label>
				<textarea id="description" name="description" class="calendarform"/><?=$event->description;?></textarea></li>
		
		<li style="position:relative;top:25px;"><label for="category">display on homepage</label>
			<?=form_dropdown('category', $category,$event->category);?></li>
		<li style="position:relative;top:15px;"><label for="homepage">display on homepage</label>
			<?=form_dropdown('homepage', $homepage,$event->homepage,'class="time"');?></li>
		<li><?=form_submit('','edit')?> <?=anchor('admin/events', 'Cancel');?></li>
			<input type="hidden" name="geocode_point" id="geocode_point" value="<?=$event->geocode_point;?>" />
			<input type="hidden" name="status" id="status" value="<?=$event->status?>" />
	</ol>
</fieldset>
<?=form_close()?>
</div>
<?php echo $this->load->view('footer');?>
